/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vical.view;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Date;
import com.toedter.calendar.*;

/**
 * The Listener for miniCal date selection
 * @author MONICA KUMAR
 */
public class MiniCalDateListener implements PropertyChangeListener {

    private ViewPanel viewPanel;
    private JCalendar jcal;

    public MiniCalDateListener(ViewPanel viewPanel) {
            this.viewPanel = viewPanel;
    }
    public MiniCalDateListener(ViewPanel viewPanel, JCalendar jcal){
            this.viewPanel = viewPanel;
            this.jcal = jcal;
    }

    public void propertyChange(PropertyChangeEvent evt) {
        if (evt.getPropertyName().equals("day")) {
          viewPanel.jumpToDate(jcal.getCalendar());
            }
    }
}
